package yxy.cherry.paycenter.database.dao;

import java.util.List;

import yxy.apple.database.BaseDAO;
import yxy.apple.database.DAOManager;
import yxy.cherry.paycenter.database.db.orders;

public class ordersDao extends BaseDAO<orders>{

	public static orders getOrderByMyorderid(String myorderid) {
		try {
			List<orders> list = queryByKey(DAOManager.getGameH(), "orders", "myorderid", myorderid);
			return (list != null && list.size() > 0) ? list.get(0) : null;
		} catch (Exception e) {
			return null;
		}
	}
	
	public static orders getOrderByPlatorderid(String platorderid) {
		try {
			List<orders> list = queryByKey(DAOManager.getGameH(), "order", "myorderid", platorderid);
			return (list != null && list.size() > 0) ? list.get(0) : null;
		} catch (Exception e) {
			return null;
		}
	}
	
	public static boolean add(orders db) {
		return ordersDao.add(DAOManager.getGameH(), db);
	}

	public static boolean update(orders db) {
		return ordersDao.update(DAOManager.getGameH(), db);
	}
}
